Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Fixes two issues with the status_set tool:

1. Emoji Validation Failures

Problem: Emojis with variation selectors (like ✏️) were incorrectly rejected by validation.

Root Cause: The validator used [...str].length to count characters, which counts code points. Emojis with variation selectors (U+FE0F) have 2 code points but represent a single grapheme cluster.

Solution: Use Intl.Segmenter (built-in API) to count grapheme clusters - what users perceive as single characters. This properly handles:

  • Variation selectors (✏️, ☀️, ➡️)
  • Skin tone modifiers (👋🏻, 👋🏽, 👋🏿)
  • Complex emojis (flags, multi-person emojis)

Example:

const segmenter = new Intl.Segmenter("en", { granularity: "grapheme" });
[...segmenter.segment("✏️")].length; // 1 (correct!)
[..."✏️"].length; // 2 (wrong - counts code points)

2. Error Message Styling

Problem: Error messages in StatusSetToolCall used text-sm class, making them smaller than surrounding text in the tool header.

Solution: Removed text-sm class so errors use the same font size as other header content.


Generated with cmux

- Use Intl.Segmenter to count grapheme clusters instead of code points
- Properly handles variation selectors (like ✏️), skin tones, and complex emojis
- Remove text-sm class from error message in StatusSetToolCall
- Add tests for emojis with variation selectors and skin tone modifiers
@ammario ammario enabled auto-merge October 28, 2025 19:00
Give agents more freedom in choosing emojis by removing prescriptive examples
like '🔍 Analyzing code'. Keep outcome examples (Success/Failure/Warning) but
remove their emoji prefixes.
Remove prescriptive emoji and message examples to give agents more freedom.
Keep guidance about setting final status but without specific format examples.
Clarify that status clears on new user message, not stream start.
- Add to tool description that status is set IMMEDIATELY
- Add code comment explaining this prevents premature success status
  (e.g., saying 'PR checks passed' when checks are still running)
@ammario ammario disabled auto-merge October 28, 2025 19:27
@ammario ammario merged commit 817a2f2 into main Oct 28, 2025
8 of 10 checks passed
@ammario ammario deleted the fix-status-set-emoji-validation branch October 28, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants